#!/bin/sh

sqlplus -s / as sysdba <<EOF
    -- Create the datakit user. Replace the password placeholder with a secure password.
    CREATE USER datakit IDENTIFIED BY 123456;

    -- Grant access to the datakit user.
    GRANT CONNECT TO datakit;
    GRANT SELECT ON GV_\$PROCESS TO datakit;
    GRANT SELECT ON gv_\$sysmetric TO datakit;
    GRANT SELECT ON sys.dba_data_files TO datakit;
    GRANT SELECT ON sys.dba_tablespaces TO datakit;
    GRANT SELECT ON sys.dba_tablespace_usage_metrics TO datakit;
    exit;
EOF
